package com.efast.dmom.mgmt.service.mes.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.efast.dmom.mgmt.dao.mes.PmFeaturValueDao;
import com.efast.dmom.mgmt.entity.mes.PmFeaturValue;
import com.efast.dmom.mgmt.service.mes.PmFeaturValueService;

@Service
public class PmFeaturValueServiceImpl implements PmFeaturValueService {

	@Autowired
	private PmFeaturValueDao pmFeaturValueDao;
	@Override
	public List<PmFeaturValue> getFeaturValueByTypeID(Integer id) {
		// TODO Auto-generated method stub
		return pmFeaturValueDao.getFeaturValueByTypeID(id) ;
	}

	@Override
	public int deletePmFeaturValueById(Integer id) {
		// TODO Auto-generated method stub
		
		return pmFeaturValueDao.deletePmFeaturValueById(id);
	}

	@Override
	public int deletePmFeaturTypeById(Integer id) {
		// TODO Auto-generated method stub
		List<PmFeaturValue> listValues = getFeaturValueByTypeID(id);
		if(listValues!=null && listValues.size()>0) {
			deletePmFeaturValueById(id);
		}
		
		return pmFeaturValueDao.deletePmFeaturTypeById(id);
	}
	

}
